package ioc02.view;

import ioc02.action.UserAction;
import ioc02.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author：汤小洋
 * Date：2022-11-22 11:15
 * Description：<描述>
 */
public class UserView {
    public static void main(String[] args) {

        String username = "tom";
        String password = "123";

        ApplicationContext ac = new ClassPathXmlApplicationContext("ioc02/spring.xml");

        UserAction userAction = (UserAction) ac.getBean("userAction");

        User user = userAction.login(username, password);

        if(user == null){
            System.out.println("登陆失败");
        }else{
            System.out.println("登陆成功");
        }


    }
}
